#ifndef _COMMON_H
#define _COMMON_H
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <dirent.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fnmatch.h>
#include <libgen.h>
#include <limits.h>

/**
 * Print error message to stderr and exit with exit_code.
 */
void error_exit(int exit_code, const char *msg, char *extra);

/**
 * The prediate interface.
 */
struct predicate {
    void *obj1;
    void *obj2;
    int (*test)(struct predicate *, struct dirent *);
    void (*destroy)(struct predicate *);
};

typedef struct predicate predicate;

/**
 * The action interface.
 */
typedef int (*action)(const char *, struct dirent *);

enum SYMLINK_OPTION {NO_FOLLOW, FOLLOW, ONLY_LEVEL0};

enum AMC_FIELDS {ACCESS, MODIFY, CHANGE};

#endif
